package fortunata.fswapps.omemo;

import fortunata.fswapps.omemo.Omemo;
import fortunata.FortunataPlugin;

/**
 * Created by IntelliJ IDEA.
 * User: Mariano Rico
 * Date: 31-oct-2006
 * Time: 23:57:48
 * To change this template use File | Settings | File Templates.
 */
 public class OntologyWikiPageName {
     private String ontologyAlias;
     private String versionDate;
     private static String wikiFileExtension = FortunataPlugin.wikiFileExtension;
     private static String prefix = Omemo.generatedOntoWikiPagesPrefix;
     public OntologyWikiPageName(String ontologyAlias, String versionDate){
         this.ontologyAlias = ontologyAlias;
         this.versionDate = versionDate;
     }
     public void reasignPrefix (String prefix) {this.prefix = prefix;}
     public void reasignWikiFileExtension (String wikiFE) {this.wikiFileExtension = wikiFE;}
     public static String getPrefix() {return prefix;}
     public static String getWikiFileExtension() {return wikiFileExtension;}
     public String getOntologyAlias() {return ontologyAlias;}
     public String getVersionDate() {return versionDate;}

    /**
     * Same as toString(). P.e: specfoaf.2005604.
     * @return Our convention for ontology Elements wiki pages
     */
     public String getOntologyWikiPageName(){return prefix + ontologyAlias + "." + versionDate + ".";}
     public String getOntologyWikiPageNameWithoutVersion() {return prefix + ontologyAlias + ".";}

    /**
     * Returs the ontology file name. P.e.: foaf.20050603.rdf"
     * @return
     */
     public String toFileName() {return ontologyAlias + "." + versionDate + ".rdf";}
    /**
     * Same as getOntologyWikiPageName(). P.e: specfoaf.2005604.
     * @return
     */
     public String toString() {return getOntologyWikiPageName();}

    public static void main (String[] args){
       OntologyWikiPageName owpnICal = new OntologyWikiPageName("ical", "200212");
       System.out.println ("file Name =" + owpnICal.toFileName());
       System.out.println ("ontology wiki page name =" + owpnICal.getOntologyWikiPageName());
       System.out.println ("ontology wiki page name =" + owpnICal);
       System.out.println ("ontology wiki page name without version=" + owpnICal.getOntologyWikiPageNameWithoutVersion());
       OntologyWikiPageName owpnFoaf = new OntologyWikiPageName("foaf", "20050403");
       System.out.println ("file Name =" + owpnFoaf.toFileName());
       System.out.println ("ontology wiki page name =" + owpnFoaf.getOntologyWikiPageName());
       System.out.println ("ontology wiki page name =" + owpnFoaf);
       System.out.println ("ontology wiki page name without version=" + owpnFoaf.getOntologyWikiPageNameWithoutVersion());
    }
}
